package com.example.bank.dao;

import com.example.bank.pojo.Client;
import com.example.bank.pojo.ClientQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ：Leeziqiang
 * @description：ClientDao接口
 * @date ：2021/12/4 9:18
 */
@Mapper
public interface ClientDao {

    Client findById(String id);

    String findByNumber(@Param("number") String clientIdNumber);

    String findNumberById(@Param("clientId") String clientId);

    int saveClient(Client client);

    List<Client> findByIds(@Param(value = "ids") List<String> ids);

    List<Client> findByState(@Param(value = "ids") List<String> ids, @Param(value = "approvalState") Integer approvalState);

    int updateApprovalState(String clientId, Integer approvalState);

    List<Client> findByQuery(@Param("clientId") String clientId, @Param("bankArea") String bankArea, @Param("approvalState") Integer approvalState);

    List<Client> list();

    int updateDeadline(String clientId, String deadline, Integer approvalState);

    List<String> listByBankArea(@Param("bankArea") String bankArea);

    List<Client> findByClientQuery(@Param("bankArea") String bankArea, @Param("approvalState") Integer approvalState, @Param("orderTime1") String orderTime1, @Param("orderTime2") String orderTIme2, @Param("ids") List<String> ids);

    // 更改客户信息
    int updateClient(Client client);

    // 删除客户信息
    int removeClient(@Param("id") String id);

    int updateQueryState(@Param("clientId") String clientId);
}
